package entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class BookingRecord extends BaseEntity {
	private String recordID;
	private Date recordDate;
	private String reponsibleStaffName;
	private String memberID;
	private String venueID;
	private int bookedStartingHour;
	private int bookedEndingHour;

	public BookingRecord(String basicRecordData) throws SecurityException, IllegalArgumentException, ParseException, NoSuchFieldException, IllegalAccessException {
		//000004 2013-04-10 Wong 000002 b01 18 22
		String[] attrVal = basicRecordData.split(" ");
		this.setRecordID(attrVal[0]);

		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd");
		this.setRecordDate(formatter.parse(attrVal[1]));
		this.setReponsibleStaffName(attrVal[2]);
		this.venueID = attrVal[3];
		this.memberID = attrVal[4];
		this.bookedStartingHour = Integer.valueOf(attrVal[5]);
		this.bookedEndingHour = Integer.valueOf(attrVal[6]);
	}
	
	public BookingRecord(String newRecordID, Date date, String staffName, String memberID, String venueID, int startHour, int endHour){
		this.setRecordID(newRecordID);
		this.setRecordDate(date);
		this.setReponsibleStaffName(staffName);
		this.memberID = memberID;
		this.venueID = venueID;
		this.bookedStartingHour = startHour;
		this.bookedEndingHour = endHour;
		
	}
	public String getReponsibleStaffName() {
		return reponsibleStaffName;
	}

	public void setReponsibleStaffName(String reponsibleStaffName) {
		this.reponsibleStaffName = reponsibleStaffName;
	}

	public Date getRecordDate() {
		return recordDate;
	}

	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}

	public String getRecordID() {
		return recordID;
	}

	public void setRecordID(String recordID) {
		this.recordID = recordID;
	}

	public int getBookedEndingHour() {
		return bookedEndingHour;
	}

	public void setBookedEndingHour(int bookedEndingHour) {
		this.bookedEndingHour = bookedEndingHour;
	}

	public int getBookedStartingHour() {
		return bookedStartingHour;
	}

	public void setBookedStartingHour(int bookedStartingHour) {
		this.bookedStartingHour = bookedStartingHour;
	}

	public String getVenueID() {
		return venueID;
	}

	public void setVenueID(String venueID) {
		this.venueID = venueID;
	}

	public String getMemberID() {
		return memberID;
	}

	public void setMemberID(String memberID) {
		this.memberID = memberID;
	}
}
